package com.oig.sys.msg.entity;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;


/**
 * @author xulele
 * 渠道类型表
 */
@Getter
@Setter
@ToString
@Entity
@Table(name = "tb_push_channel")
@EntityListeners({AuditingEntityListener.class})
public class TbPushChannel implements Serializable {

	/**
	 */
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name = "id", nullable = false)
	private Integer id;

	/**
	 * 渠道名称
	 */
	@Column(name = "channel_name")
	private String channelName;

	@Column(name = "support_msg_type")
	private String supportMsgType;

	/**
	 * 渠道类型，取推送方式的枚举
	 */
	@Column(name = "channel_type")
	private String channelType;

	/**
	 * 渠道配置json
	 */
	@Column(name = "channel_config")
	private String channelConfig;

	/**
	 * status
	 */
	@Column(name = "status")
	private String status;

	/**
	 * remark
	 */
	@Column(name = "remark")
	private String remark;

	/**
	 * 创建人id
	 */
	@CreatedBy
	@Column(name = "create_user_id")
	private Integer createUserId;

	/**
	 * 创建人名称
	 */
	@Column(name = "create_user_name")
	private String createUserName;

	/**
	 * 创建时间
	 */
	@CreatedDate
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "create_time")
	private Date createTime;

	/**
	 * 最后修改人id
	 */
	@LastModifiedBy
	@Column(name = "last_update_id")
	private Integer lastUpdateId;

	/**
	 * 最后修改人名称
	 */
	@Column(name = "last_update_name")
	private String lastUpdateName;

	/**
	 * 最后修改时间
	 */
	@LastModifiedDate
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "last_update_time")
	private Date lastUpdateTime;

	/**
	 * 版本号
	 */
	@Version
	@Column(name = "version")
	private Integer version;

	/**
	 * 所属租户id
	 */
	@Column(name = "tenant_id")
	private Integer tenantId;

	/**
	 * 所属租户名称
	 */
	@Column(name = "tenant_name")
	private String tenantName;
}
